<template>
   <el-menu
      default-active="2"
      class="el-menu-vertical-demo"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b">
      <el-submenu :index="item.id" v-for="(item, index) in menuList" :key="index">
        <template slot="title">
          <i :class="el-icon-location"></i>
          <span>{{item.name}}</span>
        </template>
        <el-menu-item-group>
          <el-menu-item :index="chil.id" v-for="(chil, index) in item.children" :key="index">{{chil.name}}</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
    </el-menu>
</template>

<script>
export default {
  data() {
    return {
      menuList:[]
    };
  },
  methods: {},
  created() {
    this.menuList = JSON.parse(sessionStorage.getItem("menuList"));
  },
};
</script>